import request from './request'

const common={
    method:"get",
    data:{}
}

export default{
    http:function(options={}){
        options.url=options.url;
        options.method=options.method||common.method;
        options.data=options.data||common.data;
        return request({
            ...options
        }).then(res=>res.data)
       
    },
    get:function(url,data={},options={}){
        options.url=url;
        options.data=data;
        options.method='get';
        return this.http(options)
        console.log(this)
    },
    post:function(url,data={},options={}){
        options.url=url;
        options.data=data;
        options.method='post';
        return this.http(options)
    },
	 // 新增收获地址的删除
	    del:function(url,data={},options={}){
	        options.url=url;
	        options.data=data;
	        options.method="delete";
	        return this.http(options)
	    },

}